home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / kernels / makedisk < prev    next >
Text File  |  1994-05-20  |  2KB  |  72 lines

  1. #!/bin/sh
  2. #define Q+D
  3. #
  4. # This makes a bootkernel disk in /dev/fd0 from a kernel image.
  5. #
  6. # Run this in a directory containing the kernels you're gonna use, and a
  7. # subdirectory with a master image of the bootkernel disk.
  8. #
  9. # This is the command to use:
  10. #
  11. # makedisk kernel_image disk_size
  12. #          ^^           ^^^^^^^^^ This is 1440 or 1200
  13. #          ^^^^^ This is the name (and maybe path to) the kernel you're going
  14. #                to use, such as scsinet/scsinet.
  15. #
  16. #
  17. KERNEL=$1
  18. DISKSIZE=$2
  19. TARGET=/dev/fd0
  20. MASTER_DIR=master
  21. #
  22. if [ $DISKSIZE = 1200 ]; then
  23.  cp lilo.conf.1200 $MASTER_DIR/etc/lilo.conf
  24.  RAMSIZE=1440
  25. elif [ $DISKSIZE = 1440 ]; then
  26.  cp lilo.conf.1440 $MASTER_DIR/etc/lilo.conf
  27.  RAMSIZE=1440
  28. else
  29.  echo
  30.  echo "Usage: makedisk kernel_image disk_size"
  31.  echo
  32.  echo "Disk is made in /dev/fd0. Target disk must be formatted."
  33.  echo "Legal disk sizes are 1200 and 1440."
  34.  echo
  35.  exit
  36. fi
  37. if [ -r $1 ]; then
  38.  echo "Making a bootkernel disk from kernel image $1..."
  39. else
  40.  echo "Image $1 not readable."
  41.  exit
  42. fi
  43. cp $1 $MASTER_DIR/vmlinuz 
  44. echo "Rdeving -R $MASTER_DIR/vmlinuz 0"
  45. rdev -R $MASTER_DIR/vmlinuz 0
  46. echo "Rdeving -r $MASTER_DIR/vmlinuz $RAMSIZE"
  47. rdev -r $MASTER_DIR/vmlinuz $RAMSIZE
  48. echo "Rdeving -v $MASTER_DIR/vmlinuz -v"
  49. rdev -v $MASTER_DIR/vmlinuz -1
  50. # It's possible some people might want to use /dev/fd0h1200 or /dev/fd0H1440
  51. # on the line below...
  52. echo "Rdeving $MASTER_DIR/vmlinuz /dev/fd0"
  53. rdev $MASTER_DIR/vmlinuz /dev/fd0
  54. #echo "Formatting the target disk..."
  55. #fdformat /dev/fd0H1200
  56. echo "Blanking the target disk..."
  57. dd if=/dev/zero of=$TARGET 2> /dev/null
  58. echo "Making the MINIX/Linux filesystem..."
  59. mkfs -t minix $TARGET $DISKSIZE
  60. echo "Mounting the disk on /mnt..."
  61. mount $TARGET /mnt
  62. cd $MASTER_DIR
  63. echo "Copying the files over..."
  64. cp -a * /mnt
  65. sync
  66. echo "Installing LILO..."
  67. lilo -r /mnt
  68. sync
  69. umount /mnt
  70. echo "Bootkernel disk created."
  71.